package com.chujian.sys.entity;

import com.baomidou.mybatisplus.annotation.KeySequence;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.chujian.framework.core.IId;
import com.chujian.framework.core.base.BaseEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;


/**
 * 功能配件定义
 *
 * @author chujian
 * @since 2021-08-05
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("sys_func_part")
@KeySequence("sys_func_part_seq")
public class SysFuncPart extends BaseEntity implements IId {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "功能配件id")
    @TableId("part_id")
    private Long partId;

    @ApiModelProperty(value = "配件名称")
    @TableField("name")
    private String name;


    @ApiModelProperty(value = "配件类型(1:表 2：表单 3：操作功能参数  4：组件查询 )")
    @TableField("part_type")
    private String partType;


    @ApiModelProperty(value = "键")
    @TableField("k")
    private String k;

    @ApiModelProperty(value = "值")
    @TableField("v")
    private String v;

    @ApiModelProperty(value = "功能标识")
    @TableField("func_key")
    private String funcKey;

    @ApiModelProperty(value = "配置json")
    @TableField("cfg")
    private String cfg;

    @ApiModelProperty(value = "来源key")
    @TableField("from_key")
    private String fromKey;

    // ++++++ 系统拓展 +++++++
    @TableField(exist = false)
    private Map<String, String> query = new HashMap<>();

    @Override
    public Long getId() {
        return this.partId;
    }

    @Override
    public void setId(Serializable id) {
        if (null != id) {
            this.partId = Long.parseLong("" + id);
        }
    }

    // ++++++ 业务拓展 +++++++
}
